package com.qf.day06;

import java.util.Scanner;

public class UserMenu {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        User[] userArray = new User[1]; //存用户的数组
        Register register = new Register();
        Login login = new Login();
        int selectNum; //菜单选择数
        while (true){

            System.out.println("请选择：1.登录 2.注册 3.退出 ");
            selectNum = scanner.nextInt();
            switch(selectNum) {
                case 1:
                    System.out.println("登录");
                    login.userLogin(userArray );
                    break;
                case 2:
                    System.out.println("注册");
                    userArray =  register.userReg(userArray);
                    break;
                case 3:
                    System.out.println("退出");
                    return;
                default:
                    System.out.println("输入错误，请重新输入");
            }
        }
    }
}
